]> dgit.raspbian.org Git - gnome-shell.git/commitdiff
calendar: Avoid a warning
authorFlorian Müllner <fmuellner@gnome.org>
Fri, 12 Jul 2019 03:25:54 +0000 (05:25 +0200)
committerGeorges Basile Stavracas Neto <georges.stavracas@gmail.com>
Fri, 12 Jul 2019 18:54:49 +0000 (18:54 +0000)
We will always get a results array from gjs' proxy wrapper, but it
will be empty in the error case; that is, `results` is always defined,
but `results[0]` may not be.

https://gitlab.gnome.org/GNOME/gnome-shell/merge_requests/626

js/ui/calendar.js

index 3371004fc3896c77b9c7917326219e54ec543ced..01a56baeeaad0d3e445354f37dc879e8fbdbb10a 100644 (file)
@@ -237,7 +237,7 @@ var DBusEventSource = class DBusEventSource {
 
     _onEventsReceived(results, error) {
         let newEvents = [];
-        let appointments = results ? results[0] : null;
+        let appointments = results[0] || null;
         if (appointments != null) {
             for (let n = 0; n < appointments.length; n++) {
                 let a = appointments[n];